<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="common.inc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css">
<style type="text/css"><!--
#tip{
position:absolute;right:0;bottom:0;width:270px;height:0px;
background-color: #eeeeee; 
padding: 0px; 
overflow:hidden; 
display:none; 
font-size:12px; 
z-index:10; 
border: solid 1px #B3CAD0;
} 

#tip h1,#detail h1 { 
font-size:12px; 
height:25px; 
line-height:21px; 
background-color:#0066CC; 
color:#FFFFFF; 
padding:0px 3px 0px 3px; 
filter: Alpha(Opacity=100); 

} 

#tip h1 a,#detail h1 a { 
float:right; 
text-decoration:none; 
color:#FFFFFF; 
} 
div {
margin-bottom: 10px;
}
 --></style>
<link rel="stylesheet" href="./css/fusionCharts.css" type="text/css" />
<script language="javascript" src="./js/FusionCharts.js"></script>
<script language="javascript" src="./js/sale-monitor.js"></script>
<script type="text/javascript" language="javascript">
<!--
	//start 定义一个javascript对象，用于存储销售排名数据
	function saleTop(salePerson,finishedTarget){
		this.salePerson = salePerson;//销售负责人
		this.finishedTarget = finishedTarget;//已完成指标
	}
	var saleTops = new Array();
	<c:forEach var="saleTop" items="${buinessTarget.saleTop5s}">
		var finishedTarget = 0;
		<c:choose>
			<c:when test='${buinessTarget.type == "isContract"}'>finishedTarget = "${saleTop.updatePersonId}";</c:when>
			<c:when test='${buinessTarget.type == "isBackCost"}'>finishedTarget = "${saleTop.updatePersonId}";</c:when>
			<c:when test='${buinessTarget.type == "isGrossProfit"}'>finishedTarget = "${saleTop.updatePersonId}";</c:when>
			<c:when test='${buinessTarget.type == "isHand"}'>finishedTarget = "${saleTop.updatePersonId}";</c:when>
			<c:when test='${buinessTarget.type == "isGrossBackCost"}'>finishedTarget = "${saleTop.updatePersonId}";</c:when>
		</c:choose>
		saleTops.push(new saleTop("${saleTop.userName}",finishedTarget));
	</c:forEach>
	//end
	
	//start 定义一个javascript对象，用于存储销售漏斗数据
	function saleStage(id,name,rate){
		this.id = id;//销售阶段id
		this.name = name;//销售销售阶段名称
		this.rate = rate;//完成率
	}
	var saleStages = new Array();
	<c:forEach var="saleStage" items="${saleStages}">
		saleStages.push(new saleStage("${saleStage.stageCode}","${saleStage.stageName}","${saleStage.successRate}"));
	</c:forEach>
	//end


	function viewNewsNotice(id){
		window.location.href = "./newsNotice.do?action=viewNewsNotice&id="+id;
		window.location.target = "main";
	}
	
	function viewEmployeeBBS(id){
		window.location.href = "./employeeBBS.do?action=viewEmployeeBBS&id="+id;
		window.location.target = "main";
	}

	function newsNotice(){
		window.location.href = "./newsNotice.do";
		window.location.target = "main";
	}

	function scheduleManage(){
		window.location.href = "./scheduleManage.do";
		window.location.target = "main";
	}
	
	function scheduleWaringInfo(){
		if("<c:out value='${isViewScheduleRemind}'/>" == 1){
			window.location.href = "./scheduleRemind.do";
		}else{
			window.location.href = "#";
		}
		window.location.target = "main";
	}
	
	function auditWaringInfo(){
		if("<c:out value='${isViewAuditRemind}'/>" == 1){
			window.location.href = "./auditRemind.do";
		}else{
			window.location.href = "#";
		}
		window.location.target = "main";
	}
	
	function systemWaringInfo(){
		if("<c:out value='${isViewSystemRemind}'/>" == 1){
			window.location.href = "./systemRemind.do";
		}else{
			window.location.href = "#";
		}
		window.location.target = "main";
	}

	function systemRemind(){
		window.location.href = "./systemRemind.do";
		window.location.target = "main";
	}

	function auditDynamic(){
		window.location.href = "./auditManage.do?action=auditDynamic";
		window.location.target = "main";
	}

	function customerManage(){
		window.location.href = "./customerManage.do";
		window.location.target = "main";
	}

	function showHidden(id){
		var obj = document.getElementById(id);
		if(obj.style.display == "none"){
			document.getElementById(id).style.display = "block";
			document.getElementById("img"+id).src = "./images/main_down.gif";
		}else{
			document.getElementById(id).style.display = "none";
			document.getElementById("img"+id).src = "./images/main_right.gif";
		}
	}
	var handle; 
	function start() 
	{ 

		var url = "./index.do?action=mes";
		if(window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		req.open("GET", url, true);
		req.onreadystatechange = callback;
		req.send(null);
		
		//var obj = document.getElementById("tip"); 
	//	if (parseInt(obj.style.height)==0) 
		//{ obj.style.display="block"; 
		//handle = setInterval("changeH('up')",2); 
		//}else 
		//{ 
		//handle = setInterval("changeH('down')",2) 
		//} 
	} 
	function changeH(str) 
	{ 
	var obj = document.getElementById("tip"); 
	if(str=="up") 
	{ 
	if (parseInt(obj.style.height)>120) 
	clearInterval(handle); 
	else 
	obj.style.height=(parseInt(obj.style.height)+8).toString()+"px"; 
	} 
	if(str=="down") 
	{ 
	if (parseInt(obj.style.height)<8) 
	{ clearInterval(handle); 
	obj.style.display="none"; 
	} 
	else 
	obj.style.height=(parseInt(obj.style.height)-8).toString()+"px"; 
	} 
	} 
	function callback() {
		if(req.readyState == 4) {
			if(req.status == 200) {
				//alert(req.responseText);
				
				if(req.responseText != 11){
					 
					var obj = document.getElementById("tip"); 
					if (parseInt(obj.style.height)==0) 
					{ obj.style.display="block"; 
					handle = setInterval("changeH('up')",2); 
					}else 
					{ 
					handle = setInterval("changeH('down')",2) 
					} 
					var msg = req.responseXML.getElementsByTagName("s")[0];
					var msg1 = req.responseXML.getElementsByTagName("b")[0];
					//var msg = req.responseText;
					//alert(msg);
			        setMsg(msg.childNodes[0].nodeValue);
			        setMsg1(msg1.childNodes[0].nodeValue);
			        //setMsg(msg);
				}
			}
		}
	}

		function setMsg(msg) {
			//alert(msg);
			mdiv = document.getElementById("tip2");
			
				mdiv.innerHTML =  "<font style='font-weight: normal'>"+msg+"</font>";
			
		}
		function setMsg1(msg) {
			//alert(msg);
			mdiv = document.getElementById("tip3");
			
				mdiv.innerHTML =  "<font style='font-weight: normal'>"+msg+"</font>";
			
		}
			function aa(){
				window.location.href = "./index.do?action=editView";
				window.location.target = "main";
			}
-->
</script>
</head>
<body class="main_body" style="overflow-x:hidden;" onload="document.getElementById('tip').style.height='0px'">
	
	<table class="table_frame3">
		<tr>
			<td align="left" valign="top" >
				<table class="table_maintop">
					<tr>
						<td valign="top" class="title" colspan="1">&nbsp;<img src="./images/maintb.gif" height="20" width="20"/>&nbsp;我的主页</td>
						<td colspan="2" align="right"><a href="javascript:aa()" target="main">编辑</a></td>
					</tr>
					<tr>
						<td valign="top" class="">&nbsp;&nbsp;&nbsp;<fmt:formatDate value="<%=new java.util.Date() %>" pattern="EEEE yyyy年MM月dd日"/></td>
						<td valign="top" class="" align="right">上次登录：<fmt:formatDate value="${lastLogin}" pattern="MM月dd日 HH:mm"/></td>
						<td width="20"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table width="100%"> 
					<tr>
						<td valign="top" width="50%" >
							<c:forEach items="${lefts}" var="item">
									<c:if test="${item.viewMagId == 1}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('11')"><img id="img11" src="./images/main_down.gif">&nbsp;协同办公</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="newsNotice()">&nbsp;</td>
												</tr>
												<tr id="11">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="newsNotice" items="${newsNotices}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[新闻公告]&nbsp;
																	<span class="a_bule">
																		<a href="javascript:viewNewsNotice('${newsNotice.id}');" title="${newsNotice.subject}" target="main" hidefocus="true">
																			<c:choose>
																				<c:when test="${fn:length(newsNotice.subject) > 10}">${fn:substring(newsNotice.subject,0,10)}......</c:when>
																				<c:otherwise>${newsNotice.subject}</c:otherwise>
																			</c:choose> 
																		</a>&nbsp;
																		<fmt:formatDate value="${newsNotice.sendDate}" pattern="yy/MM/dd"/>
																	</span>
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="employeeBBS" items="${employeeBBSs}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[员工论坛]&nbsp;
																	<span class="a_bule">
																		<a href="javascript:viewEmployeeBBS('${employeeBBS.id}');" title="${employeeBBS.subject}" target="main" hidefocus="true">
																			<c:choose>
																				<c:when test="${fn:length(employeeBBS.subject) > 10}">${fn:substring(employeeBBS.subject,0,10)}......</c:when>
																				<c:otherwise>${employeeBBS.subject}</c:otherwise>
																			</c:choose> 
																			</a>&nbsp;
																		<fmt:formatDate value="${employeeBBS.sendDate}" pattern="yy/MM/dd"/>
																	</span>
																</td>
															</tr>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 2}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('21')"><img id="img21" src="./images/main_down.gif">&nbsp;审批动态</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="auditDynamic()">&nbsp;</td>
												</tr>
												<tr id="21">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="contract" items="${auditContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																	<c:choose>
																		<c:when test="${isAuditAllInvoice == 1 || isAuditDeptInvoice == 1}">
																			<a href="./auditManage.do?action=preAuditContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																		</c:when>
																		<c:otherwise>
																			<a href="./contract.do?action=preWaitAduitContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																		</c:otherwise>
																	</c:choose>
																	</span>待审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="contract" items="${passContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																		<a href="./contract.do" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																	</span>已通过审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="contract" items="${returnContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																		<a href="./contract.do?action=preReturnContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																	</span>未通过审核，被退回！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${auditSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																	<c:choose>
																		<c:when test="${isAuditAllInvoice == 1 || isAuditDeptInvoice == 1}">
																			<a href="./auditManage.do?action=preAuditSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																		</c:when>
																		<c:otherwise>
																			<a href="./saleCost.do?action=waitAuditSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																		</c:otherwise>
																	</c:choose>
																	</span>待审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${passSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																		<a href="./saleCost.do" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																	</span>已通过审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${returnSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																		<a href="./saleCost.do?action=returnSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																	</span>未通过审核，被退回！
																</td>
															</tr>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 3}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('31')"><img id="img31" src="./images/main_down.gif">&nbsp;我的销售状态</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif">&nbsp;</td>
													 -->
												</tr>
												<tr id="31">
													<td valign="top">
														<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25" 
															style="font-size: 11px;margin-top: 1px;text-align: center;">
															<tr>
																<td width="85" style="color: #ffffff;background: url('./images/midlineright.bmp') no-repeat;">
																	<c:choose>
																		<c:when test="${buinessTarget.assignPeriod == '1'}">
																			本月指标
																			<c:set var="title" value="本月指标"/>
																		</c:when>
																		<c:when test="${buinessTarget.assignPeriod == '2'}">
																			本季度指标
																			<c:set var="title" value="本季度指标"/>
																		</c:when>
																		<c:when test="${buinessTarget.assignPeriod == '3'}">
																			本年度指标
																			<c:set var="title" value="本年度指标"/>
																		</c:when>
																		
																	</c:choose>
																</td>
																<td background="./images/midlinemid.bmp">
																	<table cellpadding="0" cellspacing="0" border="0" width="280" height="25">
																		<tr>
																			<td>
																				<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="left" scrolldelay="160">
																				业绩指标&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;<font color="red">￥ <fmt:formatNumber value="${buinessTarget.periodTarget}" pattern="###,###,###,###"/></font>&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;完成比率&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${buinessTarget.finishedRate}" pattern="###,###,###,###.##"/>%&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;签约金额&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;￥ <fmt:formatNumber value="${buinessTarget.contractCost}" pattern="###,###,###,###"/>&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;申请费用&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;￥ <fmt:formatNumber value="${buinessTarget.saleCost}" pattern="###,###,###,###"/>
																				</marquee>
																			</td>
																		</tr>
																	</table>
																</td>
																<td width="20" style="background: url('./images/midlineleft.bmp') no-repeat;"></td>
															</tr>
														</table>
														<table class="table">
															<tr>
																<td valign="top">
																	<table class="table" style="height: 300px;">
																		<tr>
																			<td align="left" style="border-bottom: solid 1px #B3CAD0;">我的季度销售漏斗</td>
																		</tr>
																		<tr>
																			<td style="width: 300px;height: 300px;text-align: center;">
																				<div id="chartdiv" align="center">季度漏斗分析图</div>
																				<script type="text/javascript">
																					saleFunnelImageMain(saleStages);
																				</script>
																			</td>
																		</tr>
																		<tr>
																			<td align="left"><img src="./images/fun.gif"/></td>
																		</tr>
																	</table>
																</td>
																<td>
																	<table cellpadding="0" cellspacing="0" border="0" height="100%">
																		<tr>
																			<td>
																				<div id="chartdiv11" align="left">周期预测图</div>
																				<script type="text/javascript">
																					saleImage2("chartdiv11",${buinessTarget.targetSign1},${buinessTarget.targetSign2},${buinessTarget.targetSign3},${buinessTarget.predictCost});
																				</script>
																			</td>
																		</tr>
																		<tr><td style="color: #60634e;font-weight: bold;">业绩预测</td></tr>
																	</table>
																	<table cellpadding="0" cellspacing="0" border="0" height="100%">
																	<tr>
																		<td>
																			<div id="chartdiv12" align="left">周期完成图</div>
																			<script type="text/javascript">
																				saleImage2("chartdiv12",${buinessTarget.targetSign1},${buinessTarget.targetSign2},${buinessTarget.targetSign3},${buinessTarget.finishedTarget});
																			</script>
																		</td>
																	</tr>
																	<tr><td style="color: #60634e;font-weight: bold;">业绩达成</td></tr>
																</table>
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 4}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('41')"><img id="img41" src="./images/main_down.gif">&nbsp;我最近变化的商机</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="customerManage()">&nbsp;</td>
												</tr>
												<tr id="41">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="saleCustomer" items="${saleCustomers}" begin="0" end="5">
															<c:if test="${(saleCustomer.saleStageId > 0 || saleCustomer.saleStatus > 0) && not empty saleCustomer.updateSaleStageDate}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[
																	<c:choose>
																		<c:when test="${saleCustomer.saleStatus == '1' || saleCustomer.saleStatus == '2' || saleCustomer.saleStatus == '21'}">挂起</c:when>
																		<c:when test="${saleCustomer.saleStatus == '3' || saleCustomer.saleStatus == '4'}">关闭商机</c:when>
																		<c:when test="${saleCustomer.saleStageId > 0 && (saleCustomer.saleStatus == '0' || empty saleCustomer.saleStatus)}">${saleCustomer.saleStage}</c:when>
																	</c:choose>
																	]&nbsp;
																	<span class="a_bule">
																		<a href="./customerManage.do?action=customerDetail&customerId=${saleCustomer.id}&sign=11" hidefocus="true">${saleCustomer.customerName}</a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 5}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('12')"><img id="img12" src="./images/main_down.gif">&nbsp;销售精英榜</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif">&nbsp;</td>
													 -->
												</tr>
												<tr id="12">
													<td valign="top" align="center">
														<table class="table">
															<tr>
																<td align="center">
																	<div id="chartdiv141" align="center">销售排名前三</div>
																	<script type="text/javascript">
																		saleSortTop5Image("chartdiv141",saleTops);
																	</script>
																</td>
															</tr>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 6}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('22')"><img id="img22" src="./images/main_down.gif">&nbsp;我的日程</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="scheduleManage()">&nbsp;</td>
												</tr>
												<tr id="22">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:set var="currentDate"><fmt:formatDate value='<%=new java.util.Date()%>' pattern='yyyy-MM-dd'/></c:set>
															<c:forEach var="warningInfo" items="${warningInfoBySchedules}">
															<c:set var="warningDate"><fmt:formatDate value='${warningInfo.warningDate}' pattern='yyyy-MM-dd'/></c:set>
															<c:if test="${warningDate == currentDate && warningInfo.agingDay == 1}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[上午]&nbsp;
																	<c:forEach var="contactWay" items="${contactWays}">
																		<c:if test='${warningInfo.otherId == contactWay.id}'>${contactWay.rangeValue}</c:if>
																	</c:forEach>
																	&nbsp;
																	<span class="a_bule">
																		<a href="javascript:scheduleManage();" target="main" hidefocus="true"><c:choose>
																			<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																			<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																		</c:choose></a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<c:set var="currentDate"><fmt:formatDate value='<%=new java.util.Date()%>' pattern='yyyy-MM-dd'/></c:set>
															<c:forEach var="warningInfo" items="${warningInfoBySchedules}">
															<c:set var="warningDate"><fmt:formatDate value='${warningInfo.warningDate}' pattern='yyyy-MM-dd'/></c:set>
															<c:if test="${warningDate == currentDate && warningInfo.agingDay == 1}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[下午]&nbsp;
																	<c:forEach var="contactWay" items="${contactWays}">
																		<c:if test='${warningInfo.otherId == contactWay.id}'>${contactWay.rangeValue}</c:if>
																	</c:forEach>
																	&nbsp;
																	<span class="a_bule">
																		<a href="javascript:scheduleManage();" target="main" hidefocus="true"><c:choose>
																			<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																			<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																		</c:choose></a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 7}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('32')"><img id="img32" src="./images/main_down.gif">&nbsp;我最近查看的客户</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif" onclick="">&nbsp;</td>
													 -->
												</tr>
												<tr id="32">
													<td valign="top">
														<table class="table_mainin" style="">
															<c:forEach var="customer" items="${customers}">
															<c:if test="${not empty customer.viewDate}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	${customer.customerName}
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 8}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('42')"><img id="img42" src="./images/main_down.gif">&nbsp;预警信息</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="systemRemind()">&nbsp;</td>
												</tr>
												<tr id="42">
													<td valign="top" colspan="2">
														<table class="table_style">
															<tr>
																<td class="title">预警日期</td>
																<td class="title">来源</td>
																<td class="title">主题</td>
																<td class="title">客户</td>
															</tr>
															<c:forEach var="warningInfo" items="${warningInfoBySystems}">
															<tr>
																<td style="color: red;"><fmt:formatDate value="${warningInfo.warningDate}" pattern="yyyy/MM/dd"/></td>
																<td>
																	<c:choose>
																		<c:when test="${warningInfo.warningSource == '3'}">公海</c:when>
																		<c:when test="${warningInfo.warningSource == '5'}">其他</c:when>
																	</c:choose>
																</td>
																<td>
																	<c:choose>
																		<c:when test="${warningInfo.warningCode == 'openSeaRemind'}">
																			<c:choose>
																				<c:when test="${warningInfo.isAging == '1'}">${warningInfo.foreignName}&nbsp;&nbsp;${warningInfo.agingDay}天超期</c:when>
																				<c:when test="${warningInfo.isAging == '2'}">${warningInfo.foreignName}&nbsp;&nbsp;已被转移</c:when>
																			</c:choose>
																		</c:when>
																		<c:when test="${warningInfo.warningCode == 'contractRemind'}">
																			到期合同：编号${warningInfo.foreignCode}&nbsp;&nbsp;${warningInfo.foreignName}
																		</c:when>
																	</c:choose>
																</td>
																<td>
																	<c:choose>
																		<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																		<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																	</c:choose>
																</td>
															</tr>
															</c:forEach>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
							</c:forEach>
						</td>
						<td valign="top" width="50%">
							<c:forEach items="${rights}" var="item">
									<c:if test="${item.viewMagId == 1}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('11')"><img id="img11" src="./images/main_down.gif">&nbsp;协同办公</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="newsNotice()">&nbsp;</td>
												</tr>
												<tr id="11">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="newsNotice" items="${newsNotices}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[新闻公告]&nbsp;
																	<span class="a_bule">
																		<a href="javascript:viewNewsNotice('${newsNotice.id}');" title="${newsNotice.subject}" target="main" hidefocus="true">
																			<c:choose>
																				<c:when test="${fn:length(newsNotice.subject) > 10}">${fn:substring(newsNotice.subject,0,10)}......</c:when>
																				<c:otherwise>${newsNotice.subject}</c:otherwise>
																			</c:choose> 
																		</a>&nbsp;
																		<fmt:formatDate value="${newsNotice.sendDate}" pattern="yy/MM/dd"/>
																	</span>
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="employeeBBS" items="${employeeBBSs}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[员工论坛]&nbsp;
																	<span class="a_bule">
																		<a href="javascript:viewEmployeeBBS('${employeeBBS.id}');" title="${employeeBBS.subject}" target="main" hidefocus="true">
																			<c:choose>
																				<c:when test="${fn:length(employeeBBS.subject) > 10}">${fn:substring(employeeBBS.subject,0,10)}......</c:when>
																				<c:otherwise>${employeeBBS.subject}</c:otherwise>
																			</c:choose> 
																			</a>&nbsp;
																		<fmt:formatDate value="${employeeBBS.sendDate}" pattern="yy/MM/dd"/>
																	</span>
																</td>
															</tr>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 2}">
										<div style="width: 100%;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('21')"><img id="img21" src="./images/main_down.gif">&nbsp;审批动态</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="auditDynamic()">&nbsp;</td>
												</tr>
												<tr id="21">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="contract" items="${auditContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																	<c:choose>
																		<c:when test="${isAuditAllInvoice == 1 || isAuditDeptInvoice == 1}">
																			<a href="./auditManage.do?action=preAuditContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																		</c:when>
																		<c:otherwise>
																			<a href="./contract.do?action=preWaitAduitContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																		</c:otherwise>
																	</c:choose>
																	</span>待审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="contract" items="${passContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																		<a href="./contract.do" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																	</span>已通过审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="contract" items="${returnContracts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[合同审核]&nbsp;
																	<span class="a_bule">
																		<a href="./contract.do?action=preReturnContract" hidefocus="true">合同编号：${contract.contractCode}</a>&nbsp;
																	</span>未通过审核，被退回！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${auditSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																	<c:choose>
																		<c:when test="${isAuditAllInvoice == 1 || isAuditDeptInvoice == 1}">
																			<a href="./auditManage.do?action=preAuditSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																		</c:when>
																		<c:otherwise>
																			<a href="./saleCost.do?action=waitAuditSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																		</c:otherwise>
																	</c:choose>
																	</span>待审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${passSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																		<a href="./saleCost.do" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																	</span>已通过审核！
																</td>
															</tr>
															</c:forEach>
															<c:forEach var="saleCost" items="${returnSaleCosts}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;[费用审核]&nbsp;
																	<span class="a_bule">
																		<a href="./saleCost.do?action=returnSaleCost" hidefocus="true">费用编号：${saleCost.saleCostCode}</a>&nbsp;
																	</span>未通过审核，被退回！
																</td>
															</tr>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 3}">
										<div style="width: 100%;margin-bottom: 15px;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('31')"><img id="img31" src="./images/main_down.gif">&nbsp;我的销售状态</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif">&nbsp;</td>
													 -->
												</tr>
												<tr id="31">
													<td valign="top">
														<table cellpadding="0" cellspacing="0" border="0" width="100%" height="25" 
															style="font-size: 11px;margin-top: 1px;text-align: center;">
															<tr>
																<td width="85" style="color: #ffffff;background: url('./images/midlineright.bmp') no-repeat;">
																	<c:choose>
																		<c:when test="${buinessTarget.assignPeriod == '1'}">
																			本月指标
																			<c:set var="title" value="本月指标"/>
																		</c:when>
																		<c:when test="${buinessTarget.assignPeriod == '2'}">
																			本季度指标
																			<c:set var="title" value="本季度指标"/>
																		</c:when>
																		<c:when test="${buinessTarget.assignPeriod == '3'}">
																			本年度指标
																			<c:set var="title" value="本年度指标"/>
																		</c:when>
																		<c:otherwise></c:otherwise>
																	</c:choose>
																</td>
																<td background="./images/midlinemid.bmp">
																	<table cellpadding="0" cellspacing="0" border="0" width="280" height="25">
																		<tr>
																			<td>
																				<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="left" scrolldelay="160">
																				业绩指标&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;<font color="red">￥ <fmt:formatNumber value="${buinessTarget.periodTarget}" pattern="###,###,###,###"/></font>&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;完成比率&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${buinessTarget.finishedRate}" pattern="###,###,###,###.##"/>%&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;签约金额&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;￥ <fmt:formatNumber value="${buinessTarget.contractCost}" pattern="###,###,###,###"/>&nbsp;&nbsp;&nbsp;&nbsp;
																				-&nbsp;&nbsp;&nbsp;&nbsp;申请费用&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;￥ <fmt:formatNumber value="${buinessTarget.saleCost}" pattern="###,###,###,###"/>
																				</marquee>
																			</td>
																		</tr>
																	</table>
																</td>
																<td width="20" style="background: url('./images/midlineleft.bmp') no-repeat;"></td>
															</tr>
														</table>
														<table class="table">
															<tr>
																<td valign="top">
																	<table class="table" style="height: 300px;">
																		<tr>
																			<td align="left" style="border-bottom: solid 1px #B3CAD0;">我的季度销售漏斗</td>
																		</tr>
																		<tr>
																			<td style="width: 300px;height: 300px;text-align: center;">
																				<div id="chartdiv" align="center">季度漏斗分析图</div>
																				<script type="text/javascript">
																					saleFunnelImageMain(saleStages);
																				</script>
																			</td>
																		</tr>
																		<tr>
																			<td align="left"><img src="./images/fun.gif"/></td>
																		</tr>
																	</table>
																</td>
																<td>
																	<table cellpadding="0" cellspacing="0" border="0" height="100%">
																		<tr>
																			<td>
																				<div id="chartdiv11" align="left">周期预测图</div>
																				<script type="text/javascript">
																					saleImage2("chartdiv11",${buinessTarget.targetSign1},${buinessTarget.targetSign2},${buinessTarget.targetSign3},${buinessTarget.predictCost});
																				</script>
																			</td>
																		</tr>
																		<tr><td style="color: #60634e;font-weight: bold;">业绩预测</td></tr>
																	</table>
																	<table cellpadding="0" cellspacing="0" border="0" height="100%">
																	<tr>
																		<td>
																			<div id="chartdiv12" align="left">周期完成图</div>
																			<script type="text/javascript">
																				saleImage2("chartdiv12",${buinessTarget.targetSign1},${buinessTarget.targetSign2},${buinessTarget.targetSign3},${buinessTarget.finishedTarget});
																			</script>
																		</td>
																	</tr>
																	<tr><td style="color: #60634e;font-weight: bold;">业绩达成</td></tr>
																</table>
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 4}">
										<div style="width: 100%;margin-bottom: 15px;">
											<table class="table_main ">
												<tr>
													<td class="title" onclick="showHidden('41')"><img id="img41" src="./images/main_down.gif">&nbsp;我最近变化的商机</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="customerManage()">&nbsp;</td>
												</tr>
												<tr id="41">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:forEach var="saleCustomer" items="${saleCustomers}" begin="0" end="5">
															<c:if test="${(saleCustomer.saleStageId > 0 || saleCustomer.saleStatus > 0) && not empty saleCustomer.updateSaleStageDate}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[
																	<c:choose>
																		<c:when test="${saleCustomer.saleStatus == '1' || saleCustomer.saleStatus == '2' || saleCustomer.saleStatus == '21'}">挂起</c:when>
																		<c:when test="${saleCustomer.saleStatus == '3' || saleCustomer.saleStatus == '4'}">关闭商机</c:when>
																		<c:when test="${saleCustomer.saleStageId > 0 && (saleCustomer.saleStatus == '0' || empty saleCustomer.saleStatus)}">${saleCustomer.saleStage}</c:when>
																	</c:choose>
																	]&nbsp;
																	<span class="a_bule">
																		<a href="./customerManage.do?action=customerDetail&customerId=${saleCustomer.id}&sign=11" hidefocus="true">${saleCustomer.customerName}</a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 5}">
										<div style="width: 100%; margin-bottom: 15px;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('12')"><img id="img12" src="./images/main_down.gif">&nbsp;销售精英榜</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif">&nbsp;</td>
													 -->
												</tr>
												<tr id="12">
													<td valign="top" align="center">
														<table class="table">
															<tr>
																<td align="center">
																	<div id="chartdiv141" align="center">销售排名前三</div>
																	<script type="text/javascript">
																		saleSortTop5Image("chartdiv141",saleTops);
																	</script>
																</td>
															</tr>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 6}">
										<div style="width: 100%; margin-bottom: 15px;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('22')"><img id="img22" src="./images/main_down.gif">&nbsp;我的日程</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="scheduleManage()">&nbsp;</td>
												</tr>
												<tr id="22">
													<td valign="top" colspan="2">
														<table class="table_mainin" style="">
															<c:set var="currentDate"><fmt:formatDate value='<%=new java.util.Date()%>' pattern='yyyy-MM-dd'/></c:set>
															<c:forEach var="warningInfo" items="${warningInfoBySchedules}">
															<c:set var="warningDate"><fmt:formatDate value='${warningInfo.warningDate}' pattern='yyyy-MM-dd'/></c:set>
															<c:if test="${warningDate == currentDate && warningInfo.agingDay == 1}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[上午]&nbsp;
																	<c:forEach var="contactWay" items="${contactWays}">
																		<c:if test='${warningInfo.otherId == contactWay.id}'>${contactWay.rangeValue}</c:if>
																	</c:forEach>
																	&nbsp;
																	<span class="a_bule">
																		<a href="javascript:scheduleManage();" target="main" hidefocus="true"><c:choose>
																			<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																			<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																		</c:choose></a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<c:set var="currentDate"><fmt:formatDate value='<%=new java.util.Date()%>' pattern='yyyy-MM-dd'/></c:set>
															<c:forEach var="warningInfo" items="${warningInfoBySchedules}">
															<c:set var="warningDate"><fmt:formatDate value='${warningInfo.warningDate}' pattern='yyyy-MM-dd'/></c:set>
															<c:if test="${warningDate == currentDate && warningInfo.agingDay == 1}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	[下午]&nbsp;
																	<c:forEach var="contactWay" items="${contactWays}">
																		<c:if test='${warningInfo.otherId == contactWay.id}'>${contactWay.rangeValue}</c:if>
																	</c:forEach>
																	&nbsp;
																	<span class="a_bule">
																		<a href="javascript:scheduleManage();" target="main" hidefocus="true"><c:choose>
																			<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																			<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																		</c:choose></a>
																	</span>
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 7}">
										<div style="width: 100%;margin-bottom: 15px;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('32')"><img id="img32" src="./images/main_down.gif">&nbsp;我最近查看的客户</td>
													<!-- 
													<td style="text-align: right;" class="title"><img src="./images/more.gif" onclick="">&nbsp;</td>
													 -->
												</tr>
												<tr id="32">
													<td valign="top">
														<table class="table_mainin" style="">
															<c:forEach var="customer" items="${customers}">
															<c:if test="${not empty customer.viewDate}">
															<tr>
																<td>
																	<img src="./images/dot.bmp">&nbsp;
																	${customer.customerName}
																</td>
															</tr>
															</c:if>
															</c:forEach>
															<tr><td></td></tr>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
									<c:if test="${item.viewMagId == 8}">
										<div style="width: 100%;margin-bottom: 15px;">
											<table class="table_main">
												<tr>
													<td class="title" onclick="showHidden('42')"><img id="img42" src="./images/main_down.gif">&nbsp;预警信息</td>
													<td style="text-align: right;" class="title"><img style="cursor: hand;" src="./images/more.gif" onclick="systemRemind()">&nbsp;</td>
												</tr>
												<tr id="42">
													<td valign="top" colspan="2">
														<table class="table_style">
															<tr>
																<td class="title">预警日期</td>
																<td class="title">来源</td>
																<td class="title">主题</td>
																<td class="title">客户</td>
															</tr>
															<c:forEach var="warningInfo" items="${warningInfoBySystems}">
															<tr>
																<td style="color: red;"><fmt:formatDate value="${warningInfo.warningDate}" pattern="yyyy/MM/dd"/></td>
																<td>
																	<c:choose>
																		<c:when test="${warningInfo.warningSource == '3'}">公海</c:when>
																		<c:when test="${warningInfo.warningSource == '5'}">其他</c:when>
																	</c:choose>
																</td>
																<td>
																	<c:choose>
																		<c:when test="${warningInfo.warningCode == 'openSeaRemind'}">
																			<c:choose>
																				<c:when test="${warningInfo.isAging == '1'}">${warningInfo.foreignName}&nbsp;&nbsp;${warningInfo.agingDay}天超期</c:when>
																				<c:when test="${warningInfo.isAging == '2'}">${warningInfo.foreignName}&nbsp;&nbsp;已被转移</c:when>
																			</c:choose>
																		</c:when>
																		<c:when test="${warningInfo.warningCode == 'contractRemind'}">
																			到期合同：编号${warningInfo.foreignCode}&nbsp;&nbsp;${warningInfo.foreignName}
																		</c:when>
																	</c:choose>
																</td>
																<td>
																	<c:choose>
																		<c:when test="${fn:length(warningInfo.foreignName) > 10}">${fn:substring(warningInfo.foreignName,0,10)}......</c:when>
																		<c:otherwise>${warningInfo.foreignName}</c:otherwise>
																	</c:choose>
																</td>
															</tr>
															</c:forEach>
														</table>
													</td>
												</tr>
											</table>
										</div>
									</c:if>
							</c:forEach>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		
		<tr>
			<td>
			
			</td>
		</tr>
	</table>
	
	<div id="tip" style="POSITION: absolute;"><h1 ><a href="javascript:void(0)" onclick="start()">×</a>&nbsp;<img alt="" src="./images/news.gif" >&nbsp;&nbsp;您有新消息,请查收!</h1>
	
	&nbsp;&nbsp;<a href="./internalMailbox.do" target="main" id="tip2"></a><br>
	<br>
	&nbsp;&nbsp;<a href="./scheduleManage.do" target="main" id="tip3"></a>
	</div>
</body>
</html>
<script language="JavaScript">
window.attachEvent("onload", myTimer);    //绑定到onload事件
function myTimer() {
    start();
    window.setTimeout("myTimer()",30000);//设置循环时间

}
</script> 